import asyncio
import logging

from errors.dict_errors import *
from handlers.user_handlers import *
from keyboards.set_menu import *
from lexicon.lexicon_ru import *
from config_data.config import BOT_TOKEN
from handlers import join_to_family, common, create_family, add_purchase, choose_active_family, get_report
from aiogram import Bot, Dispatcher
from aiogram.fsm.storage.memory import MemoryStorage


async def main():
    logging.basicConfig(
        level=logging.INFO,
        format="%(asctime)s - %(levelname)s - %(name)s - %(message)s",
    )
    dp = Dispatcher(storage=MemoryStorage())
    bot = Bot(token=BOT_TOKEN)

    dp.include_routers(join_to_family.router, common.router, create_family.router, add_purchase.router,
                       choose_active_family.router, get_report.router)

    await dp.start_polling(bot)


if __name__ == '__main__':
    asyncio.run(main())
